package com.chenfubing.ps.service.impl;

import com.chenfubing.ps.entity.Auth;
import com.chenfubing.ps.mapper.AuthMapper;
import com.chenfubing.ps.service.IAuthService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author chenfubing
 * @since 2020-05-05
 */
@Service
public class AuthServiceImpl extends ServiceImpl<AuthMapper, Auth> implements IAuthService {

    @Override
    public void addAuth(Auth auth) {
        baseMapper.insert(auth.setCarState(2));
    }

    @Override
    public void passAuth(int id) {

        baseMapper.updateById(new Auth().setAuthId(id).setCarState(1));

    }

    @Override
    public void rejectAuth(int id) {
        baseMapper.updateById(new Auth().setAuthId(id).setCarState(3));
    }
}
